"""
@name:08-02
@author:wei
@projectname:上课笔记
"""
def withdrawal(user1):

    if money1 > user1:
        print("金额超出")
    elif user1 > ATM:
        print("余额不足")
    else:
        user = user1 - money1

user_name = input("请输入用户名:")
passwd = input("请输入密码：")
ATM = 50000
user = 5000


if user_name == "root" and passwd == "123456":
    print("登录成功")
    print("******菜单******")
    while True:
        choice = input("输入1取款\n输入2存款\n输入3查询\n输入4退出\n请输入你的选择：")
        if choice == '1':
            money1 = int(input("请输入你的取款金额："))
            withdrawal(user)

        elif choice == '2':
            money2 = int(input("请输入你的存款金额："))
            user = user + money2
        elif choice == '3':
            print("你的剩余金额为：", user)
        elif choice == '4':
            break
        else:
            print("输入错误")
else:
    print("登录失败")



